import {
    BaseEntity,
    Entity,
    Column,
    PrimaryGeneratedColumn,
    CreateDateColumn,
    UpdateDateColumn,
} from 'typeorm'

@Entity()
class Receive extends BaseEntity {
    @PrimaryGeneratedColumn('increment')
    id: number | undefined

    @Column()
    from: string = ''

    @Column()
    to: string = ''

    @Column()
    symbol: string = ''

    @Column()
    amount: string = '0'

    @Column()
    hash: string = ''

    @Column({nullable: true})
    statusCode?: number

    @CreateDateColumn({type: 'datetime'})
    createdAt: Date = new Date()

    @UpdateDateColumn({type: 'datetime'})
    updatedAt: Date = new Date()
}

export { Receive }
